package com.qf.feigndemo.feignclient;

import com.qf.common.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

// 注解后面写微服务的名字
@FeignClient("service-provider")
public interface ProviderFeignClient {

    // 注意，写feignclient时，把方法参数前面的注解补全
    @GetMapping("/test1")
    public String echo(@RequestParam("msg") String msg);

    @GetMapping("/user/getall")
    public List<User> getAll();

    @PostMapping("/user/update")
    User updateUser(@RequestBody User user);


    @DeleteMapping("/user/delete/{id}")
    User deleteUser(@PathVariable("id") Integer id);

}
